//
//  NSself+Category.m
//  CommonKit
//
//  Created by guohongqi on 2021/7/8.
//

#import "NSString+HQCategory.h"

@implementation NSString (HQCategory)

// 空返回YES
- (BOOL)stringIsOrSafe
{
    if ([self isEqual:@"NULL"] || [self isKindOfClass:[NSNull class]] || [self isEqual:[NSNull null]] || [self isEqual:NULL] || [[self class] isSubclassOfClass:[NSNull class]] || self == nil || self == NULL || [self isKindOfClass:[NSNull class]] || [self isEqual:@"<null>"] || [self isEqual:@"(null)"])
    {
        return YES;
    }
    else if([self isKindOfClass:[NSString class]] && [[self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length]==0)
    {
        return YES;
    }
    else
    {
        return NO;
    }
}

@end
